#pragma once

#include <bofcl_eclic_r.h>

// ECLIC中cliccfg寄存器定义
typedef struct {
	u8_s : 1;
	u8_s nlbits : 4;
	u8_s : 3;
} eclic_cliccfg_s;

_Static_assert(sizeof(eclic_cliccfg_s) == 1,
	       "Struct eclic_cliccfg_s defined error!");

static inline void eclic_wreg_cliccfg_s_by_q(u32_s eclic_q,
					     eclic_cliccfg_s cliccfg) {
	union {
		eclic_cliccfg_s c;
		u8_s u;
	} cu = {
		.c = cliccfg,
	};
	eclic_wreg_u8_by_q(eclic_q, ECLIC_CLICCFG_R, T8B_0_R, cu.u);
}
